cmake_minimum_required(VERSION 3.10.2)
project(relational_store)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-std=c++1y -fno-rtti -fvisibility=default -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0 -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../mock)
set(KV_STORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../kv_store)
add_definitions(-DNAPI_EXPERIMENTAL)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/appdatafwk/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/dataability/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_data_ability_adapter/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_data_share_adapter/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_device_manager_adapter/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_bms_adaptor/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataability/src relational_store_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/rdb/src relational_store_src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_bms_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataability/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/rdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/appdatafwk/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/dataability/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb_data_ability_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb_data_share_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb_device_manager_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/rdb_bms_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_data_share_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_device_manager_adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/rdb_bms_adaptor/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../datamgr_service/services/distributeddataservice/adapter/include/dfx)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../data_share/interfaces/inner_api/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../data_share/interfaces/inner_api/consumer/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../data_share/interfaces/inner_api/provider/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/safwk/native/include)
include_directories(${MOCK_DIR}/sqlite/include)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)
include(${KV_STORE_DIR}/interfaces/CMakeLists.txt OPTIONAL)

set(links secure mock adapter distributeddb kvdb)
add_library(relational_store SHARED ${relational_store_src})
target_link_libraries(relational_store ${links})